﻿using System.Collections.Generic;
using System.Text;
using System.Linq;
using System;
using System.Threading.Tasks;
using Elderos.Highlight.Search;
using Elderos.Ontology;

namespace Elderos.Highlight.Services
{
    public class HighlighterService : IHighlighterService
    {
        Highlighter _highlighter;

        public HighlighterService(ISearchStrategy searchStrategy, ISearchResultAdapter adapter, IRanker ranker, IAmbiguityResolver ambiguityResolver, IOntologyData ontology)
        {
            _highlighter = new Highlighter(new[]{searchStrategy}, adapter, ranker, ambiguityResolver, ontology);
        }
        #region Implementation of IHighlighterService

        public Task<HighlightResult> HighlightText(HighlightArgs args)
        {
            return Task.Run(() => _highlighter.Highlight(args.Text));
        }

        #endregion
    }
}